<?php
namespace app\admin\controller;

use app\admin\model\Login as LoginModel;
use think\Controller;

class Login extends Controller
{
    public function index()
    {
        return $this->fetch('login');
    }
    public function verify()
    {
        $data = input('post.');
        $obj = new LoginModel();
        $result = $obj->juedgeParam($data);
        if ($result == 4) {
            $this->error('验证码不正确', 'index');
        } else {
            if ($result == 3) {
                $this->success('登录成功', 'index/index');

            } else {
                $this->error('用户名或者密码不正确');
            }
        }

    }
    public function loginOut()
    {
        session(null);
        return $this->fetch('login');
    }
}
